import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

/**
 * 水平排列的按钮组
 */
class ButtonBarDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('ButtonBar示例'),
        centerTitle: true,
      ),
      body: Center(
        child: ButtonBar(
          mainAxisSize: MainAxisSize.min,
          alignment: MainAxisAlignment.end,
          children: <Widget>[
            RaisedButton(
              //设置onPressed:null之后  设置color没效果，需要设置 onPressed: ()=>{}之后，颜色才有颜色效果
              onPressed: ()=>{},
              child: Text(
                '取消',
                style: TextStyle(fontSize: 15, color: Colors.grey),
              ),
            ),
            RaisedButton(
              color: Colors.blue,
              textColor: Colors.white,
              onPressed: ()=>{},
              child: Text(
                '确定',
                style: TextStyle(fontSize: 15),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
